#ifndef __SCSI_H__
#define __SCSI_H__
#include <cnix/dma.h>

#define SECTOR_SIZE	512

#define BLK_MAX_CDB 16
/*
 *SCSI opcodes
 */
#define READ_6                0x08
#define WRITE_6               0x0a
#define READ_10               0x28
#define WRITE_10              0x2a
#define READ_12               0xa8
#define WRITE_12              0xaa
#define READ_16               0x88
#define WRITE_16              0x8a

struct scsi_data_buffer {
  struct sg_table table;
  unsigned length;
  int resid;
};

struct scsi_cmnd {
	enum dma_data_direction sd_data_direction;

  /* These elements define the operation we are about to perform */
  unsigned char cmnd[BLK_MAX_CDB];

  /* These elements define the operation we ultimately want to perform */
  struct scsi_data_buffer sdb;
};

static inline unsigned scsi_bufflen(struct scsi_cmnd *cmd)
{     
  return cmd->sdb.length;
}  
#endif
